package com.hongshu.idle.controller.idle;

import com.hongshu.common.core.enums.Result;
import com.hongshu.idle.service.idle.IIdlePaymentOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 闲宝订单
 *
 * @author: hongshu
 */
@RequestMapping("/payment/order")
@RestController
public class IdlePaymentOrderController {

    @Autowired
    private IIdlePaymentOrderService paymentService;


    /**
     * 创建订单
     *
     * @param productOrderId 订单信息
     */
    @GetMapping("createPayment")
    public Result<?> createOrder(String productOrderId) {
        return Result.ok(paymentService.createPaymentOrder(productOrderId));
    }

    @GetMapping("getPaymentOrder")
    public Result<?> getPaymentOrder(String paymentOrderId) {
        return Result.ok(paymentService.getPaymentOrder(paymentOrderId));
    }
}
